//	var grid = efgrid.getGridObject( "ef_grid_r" );
//	alert("隐藏列数："+grid.getInvisibleColCount()+"\n"
//		+"隐藏col[0]对象："+grid.getInvisibleColumn(0, TYPE_DATA).getEname()+"\n"
//		+"隐藏grid[0][0]数据："+grid.getCellValue( 0, 0, TYPE_DATA,true)+"\n"
//		+"显示列数："+grid.getColCount()+"\n"
//		+"显示col[0]对象："+grid.getColumn(0, TYPE_DATA).getEname()+"\n"
//		+"显示grid[0][0]数据："+grid.getCellValue( 0, 0, TYPE_DATA,false)+"\n"
//		+"选中的行数："+grid.getCheckedRowCount()+"\n"
//		+"表格总的行数："+grid.getCount()+"\n"
//		+"表格每页行数："+grid.getLimit()+"\n"  
//		+"第[0]行某个字段值："+grid.getCellValueByColumnName(0,"fdKeyId")+"\n"
//		+"第[0]行是否选中："+grid.isRowChecked(0)+"\n"
//		+"第[0]行是否新增行："+grid.isNewLine(0)+"\n"
//		+"表格当前行数："+grid.getRowCount()+"\n"
//		+"表格当前行的行号："+grid.getCurrentRowIndex()+"\n"
//		+"表格选中行的数据："+grid.getSelectRowsData()+"[0]['fdKeyId']; \n"
//		+"表格第0行的数据："+grid.getRowData(0)+"\n"
//		+"设置第0行为选中：grid.setRowChecked ( 0, true )\n"
//		//+"所有列："+JSON.stringify(grid.getAllColumns())+"\n"
//		//+"根据名称获取列："+JSON.stringify(grid.getColumnByName("fdKeyId"))+"\n"
//		); 
//		efgrid.setDisplayStyle( "ef_grid_r", 2, 7, "color",  "blue", TYPE_DATA );  // 改变数据列第2行第7列的前景色为蓝色
//		efgrid.setDisplayStyle( "ef_grid_r", 1, 1, "backgroundColor", "orange", TYPE_FIX );  // 改变固定列第0行第1列的背景色为橙色
//		efgrid.submitInqu( "ef_grid_r", "","ZMCP01","query");//提交表单查询id为ef_grid_r的表格数据
//		efgrid.submitForm( "ef_grid_r", "","ZMCP01","update",true );// 提交表单id为ef_grid_r的表格数据 
//		var grid_ids = [];
//		grid_ids.push( "ef_grid_r" );
//		grid_ids.push( "ef_grid_s" );
//		efgrid. submitGridsData (grid_ids, "","ZMCP01","update" );
//		efgrid.submitAllGridsData = function("", "ZMCP01", "update");//提交所有表格选中的数据。 
//grid.getRowData(row_index);
//grid.getSelectRowsData()[0]["fdPlanStatus"] 选中行的数据

/**
 * 隐藏所有的region
 */
function hideAllRegions(_regions)
{
	for (x in _regions)
	{
		$('#'+_regions[x]).hide();
	}
}
/**
 * 判断是否选中了一条数据
 * @param gridid--表格id
 * @returns {Number}
 */
function isSelectedOne(gridid)
{
	var grid = efgrid.getGridObject(gridid);
	var rowLength = grid.getCheckedRowCount();
	if(rowLength<1){ 
		SCZXAlertError("请选择一条项目信息！");
		return 0;
	}
	if(rowLength>1){
		SCZXAlertError("只能选择一条项目信息进行操作！");
		return 0;
	}
	return grid;
}
/**
 * 判断是否有选中记录
 * @param gridid
 * @returns {Number}
 */
function isSelected(gridid) {
	  var grid = efgrid.getGridObject(gridid);
	  var rowslength = grid.getCheckedRowCount();
	  if(rowslength<=0){ 
		  SCZXAlertError("请至少选择一条数据！");
		  return 0;
	  } 
	  return grid;
} 
 
/**
 * 获取页面详细信息 
 * 注：将id为=region的区域下当前block名称的所有信息组装成resultBlock，方便提交后台
 * Author:张坤--2016年3月1日08:52:03
 * @param region--所属div
 * @param blockname--block名称
 * @returns {EiInfo}
 */
var getDetail=function(region,blockname) { 
	var info  = new EiInfo();
	var block = new EiBlock("result"); 
	info.addBlock(block); 
	var meta=new EiBlockMeta(); 
	var row={};
	var indexs=0; 
	//遍历INPUT
	$('#'+region).find("input").each(function (){
		var column=new EiColumn($(this).attr("id").replace(blockname+'-0-',''));//.attr("id").substring(13)); 
		column.pos=indexs; 
		meta.addMeta(column); 
		row[indexs]=$(this).val();  
		indexs++;
	});
	//遍历SELECT
	$('#'+region).find("select").each(function (){
		var column=new EiColumn($(this).attr("id").replace(blockname+'-0-','')); 
		column.pos=indexs; 
		meta.addMeta(column); 
		row[indexs]=$(this).val();  
		indexs++;
	});
	//遍历TEXTAREA
	$('#'+region).find("textarea").each(function (){
		var column=new EiColumn($(this).attr("id").replace(blockname+'-0-','')); 
		column.pos=indexs; 
		meta.addMeta(column); 
		row[indexs]=$(this).val();  
		indexs++;
	});
	block.setBlockMeta(meta);
    block.addRow(row); 
	//alert(JSON.stringify(info)); 
	return info;
};  

/**
 * 获取页面详细信息 
 * 注：将id为=region的区域下当前block名称的所有信息组装成resultBlock，方便提交后台
 * Author:王伟--2016年8月15日23:15:03
 * @param region--所属div
 * @param blockname--block名称
 * @returns {EiInfo}
 */
var getDetailbyBlockname=function(region,blockname) { 
	var info  = new EiInfo();
	var block = new EiBlock(blockname); 
	info.addBlock(block); 
	var meta=new EiBlockMeta(); 
	var row={};
	var indexs=0; 
	//遍历INPUT
	$('#'+region).find("input").each(function (){
		var column=new EiColumn($(this).attr("id").replace(blockname+'-0-',''));//.attr("id").substring(13)); 
		column.pos=indexs; 
		meta.addMeta(column); 
		row[indexs]=$(this).val();  
		indexs++;
	});
	//遍历SELECT
	$('#'+region).find("select").each(function (){
		var column=new EiColumn($(this).attr("id").replace(blockname+'-0-','')); 
		column.pos=indexs; 
		meta.addMeta(column); 
		row[indexs]=$(this).val();  
		indexs++;
	});
	//遍历TEXTAREA
	$('#'+region).find("textarea").each(function (){
		var column=new EiColumn($(this).attr("id").replace(blockname+'-0-','')); 
		column.pos=indexs; 
		meta.addMeta(column); 
		row[indexs]=$(this).val();  
		indexs++;
	});
	block.setBlockMeta(meta);
    block.addRow(row); 
	//alert(JSON.stringify(info)); 
	return info;
};  

function clearRegion(gridid) {
    var grid = efgrid.getGridObject(gridid);
    while (grid.getRowCount() > 0)
        grid.removeRow(0);
    grid.refresh();
}

function getSCZXEiInfos(_form,_grid)
{
	var _info = new EiInfo();
	_info.setByNodeObject(document.forms[_form]);
	var grid = efgrid.getGridObject(_grid);
	var block = grid.blockData;
	var tmpBlock = new EiBlock("result");
    tmpBlock.setBlockMeta(block.getBlockMeta());
    var r = block.getRows();
    for(i=0;i<grid.getRowCount();i++){
    	if(grid.isRowChecked(i)){
            tmpBlock.addRow(r[i]);
    	}
    }
    _info.addBlock(tmpBlock);
    return _info;
}

function getNowDate()
{
   var now = new Date();
   var year = now.getFullYear();       //年
   var month = now.getMonth() + 1;     //月
   var day = now.getDate();            //日
   var clock = year + "-";
   if(month < 10) clock += "0";
   clock += month + "-";
   if(day < 10) clock += "0";
   clock += day; 
   return clock;
}

function getNowDateTime() {
	var now = new Date();

	var year = now.getFullYear(); // 年
	var month = now.getMonth() + 1; // 月
	var day = now.getDate(); // 日
	var hh = now.getHours(); // 时
	var mm = now.getMinutes(); // 分
	var ss = now.getSeconds(); // 秒
	var clock = year + "-";
	if (month < 10)
		clock += "0";
	clock += month + "-";

	if (day < 10)
		clock += "0";
	clock += day + " ";

	if (hh < 10)
		clock += "0";
	clock += hh + ":";
	
	if (mm < 10)
		clock += '0';
	clock += mm + ":";

	if (ss < 10)
		clock += '0';
	clock += ss;
	return (clock);
}

function getCurrentDate(){
    var mydate = new Date();
    var str = "" + mydate.getFullYear() + "-";

    if((mydate.getMonth() + 1) < 10)
    	str += "0" + (mydate.getMonth()+1) + "-";
    else
    	str += (mydate.getMonth()+1) + "-";
    
    if(mydate.getDate() < 10)
    	str += "0" + mydate.getDate();
    else
    	str += mydate.getDate();
    return str;
}

function SCZXAlert(content)
{
	//ef.get( "_eiMsg" ).innerHTML=content;
	EFAlert(content);
}

function SCZXAlertError(content) 
{
	//ef.get( "_eiMsg" ).innerHTML="<font color='red'>"+content+"</font>";
	EFAlert(content);
}